﻿using STMS.Models.VModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace STMS.DAL
{
    /// <summary>
    /// 仓库分区温度信息实体
    /// </summary>
    public  class ViewSRegionTemperDAL:BQuery<ViewSRegionTemperInfo>
    {
        /// <summary>
        /// 查询仓库分区温度信息
        /// </summary>
        /// <param name="storeId"></param>
        /// <param name="temperState"></param>
        /// <returns></returns>
        public List<ViewSRegionTemperInfo>  GetSRegionTemperList(int storeId,int temperState)
        {
            string strWhere = "1=1";
            if (storeId > 0)
                strWhere += $" and StoreId={storeId}";
            if(temperState>-1&&temperState<3)
            {
                strWhere += $" and TemperState={temperState}";
            }
            strWhere += " order by StoreId,SRegionId";
            string cols = CreateSql.GetColsString<ViewSRegionTemperInfo>("TemperRange");
            return GetModelList(strWhere, cols);
        }
    }
}
